<?php

/**
 * ParteCuerpoHumanoImagen form base class.
 *
 * @package    form
 * @subpackage parte_cuerpo_humano_imagen
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseParteCuerpoHumanoImagenForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                     => new sfWidgetFormInputHidden(),
      'parte_cuerpo_humano_id' => new sfWidgetFormDoctrineChoice(array('model' => 'ParteCuerpoHumano', 'add_empty' => false)),
      'path'                   => new sfWidgetFormInput(),
      'main'                   => new sfWidgetFormInput(),
      'size'                   => new sfWidgetFormInput(),
      'width'                  => new sfWidgetFormInput(),
      'height'                 => new sfWidgetFormInput(),
      'full_mime'              => new sfWidgetFormInput(),
      'sha1'                   => new sfWidgetFormInput(),
      'slug'                   => new sfWidgetFormInput(),
      'created_at'             => new sfWidgetFormDateTime(),
      'updated_at'             => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                     => new sfValidatorDoctrineChoice(array('model' => 'ParteCuerpoHumanoImagen', 'column' => 'id', 'required' => false)),
      'parte_cuerpo_humano_id' => new sfValidatorDoctrineChoice(array('model' => 'ParteCuerpoHumano')),
      'path'                   => new sfValidatorString(array('max_length' => 255)),
      'main'                   => new sfValidatorString(array('max_length' => 1)),
      'size'                   => new sfValidatorInteger(array('required' => false)),
      'width'                  => new sfValidatorInteger(array('required' => false)),
      'height'                 => new sfValidatorInteger(array('required' => false)),
      'full_mime'              => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'sha1'                   => new sfValidatorString(array('max_length' => 32)),
      'slug'                   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'             => new sfValidatorDateTime(array('required' => false)),
      'updated_at'             => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'ParteCuerpoHumanoImagen', 'column' => array('slug')))
    );

    $this->widgetSchema->setNameFormat('parte_cuerpo_humano_imagen[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'ParteCuerpoHumanoImagen';
  }

}
